package net.godcode.olivenotes.entities;

import org.hibernate.Query;
import org.hibernate.Session;

/**
 * UserDAOHibernate
 * 
 * @author Chris Lewis Jan 2, 2008 <chris@thegodcode.net>
 * @version $Id: UserDAOHibernate.java 11 2008-01-02 01:21:40Z burningodzilla $
 */
public class UserDAOHibernate extends GenericHibernateDAO<User, Long> implements UserDAO {

	public UserDAOHibernate(Session session) {
		super();
		setSession(session);
	}
	
	public User findByUserName(String userName) {
		Query q = getSession().getNamedQuery("User.QUERY_USERNAME"); //TODO
		q.setParameter("userName", userName);
		return (User)q.uniqueResult();
	}

}
